package com.ssy.lingxi.platform.manage.repository;


import com.ssy.lingxi.platform.manage.entity.content.ContentLabel;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContentLabelRepository extends JpaRepository<ContentLabel, Long>, JpaSpecificationExecutor<ContentLabel> {

    List<ContentLabel> findAllByStatus(Integer status, Sort createTime);

    @Query(value = "SELECT * FROM man_content_label WHERE id IN (:ids)", nativeQuery = true)
    List<ContentLabel> findAllByIds(@Param("ids") List<Long> ids);
}
